/****************************************************************************
 * Copyright (C) 2025 Chenyz. All rights reserved.
 *
 * @file    TinyOS_Timer.h
 *
 * @par     dependencies
 *          - stdint.h (Standard integer types)
 *          - TinyOS_Types.h (Type definitions)
 *          - TinyOS_Objects.h (Global kernel objects)
 *          - TinyOS_Semaphore.h (Semaphore synchronization)
 *
 * @author  Chenyz
 *
 * @brief   Timer Management Header
 *          This file provides declarations for software timer operations
 *          in TinyOS, including:
 *          - Timer module initialization and configuration
 *          - One-shot and periodic timer management
 *          - Timer start, stop, and deletion operations
 *          - Timer callback execution and notification
 *
 * @version V1.0
 * @date    2025-10-03
 *
 * @note    This module implements software timers with support for both
 *          interrupt and task context execution modes.
 ****************************************************************************/

#ifndef __TINYOS_TIMER_H__
#define __TINYOS_TIMER_H__

/******************************** Includes **********************************/
#include <stdint.h>
#include "TinyOS_Types.h"
#include "TinyOS_Objects.h"
#include "TinyOS_Semaphore.h"

/*************************** Function Declarations **************************/

/* Timer management functions */
void TinyOS_TimerModuleInit(void);
void TinyOS_TimerInit(
	TinyOS_TimerType* Timer, 
	uint32_t StartDelayTicks, 
	uint32_t PeriodTicks, 
	uint32_t TimerConfig, 
	void (*pfTimerCallbacks)(void* param), 
	void* param
);
void TinyOS_TimerStop(TinyOS_TimerType* Timer);
void TinyOS_TimerStart(TinyOS_TimerType* Timer);
void TinyOS_TimerDelete(TinyOS_TimerType* Timer);
void TinyOS_TimerGetInfo(TinyOS_TimerType* Timer, TinyOS_TimerInfoType* TimerInfo);
void TinyOS_TimerHandleList(TinyOS_ListType* TimerList);
void TinyOS_TimerNotifyFromInt(void);

#endif /* __TINYOS_TIMER_H__ */

